﻿using System;

namespace gbL.NetBoard.Broadcast
{
    public interface IFilterBroadcasts
    {
        /// <summary>
        /// Limits the types of message for which the registrant will receive the Added event
        /// for which they have registered.
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="messageType">Type which is assignable to the message object (e.g. message inherits from it)</param>
        void FilterAddedByType(object registrant, Type messageType);
        /// <summary>
        /// Limits the types of message for which the registrant will receive the Removed event
        /// for which they have registered.
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="messageType">Type which is assignable to the message object (e.g. message implements it)</param>
        void FilterRemovedByType(object registrant, Type messageType);
        /// <summary>
        /// Limits the tag(s) for which the registerant will receive the message Added event
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="tag">Tag with which to filter broadcasts</param>
        void FilterAddedByTag(object registrant, object tag);
        /// <summary>
        /// Limits the tag(s) for which the registerant will receive the message Removed event
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="tag">Tag with which to filter broadcasts</param>
        void FilterRemovedByTag(object registrant, object tag);
        /// <summary>
        /// Limits the messges for which the registrant will receive the message Added event
        /// for which they have registered
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="test">Function which will test the message entry</param>
        void FilterAddedByFunc(object registrant, Func<IBlackboardEntry, bool> test);
        /// <summary>
        /// Limits the tag(s) for which the registerant will receive the message Removed event
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="tag">Function which will test the message entry</param>
        void FilterRemovedByFunc(object registrant, Func<IBlackboardEntry, bool> test);
        /// <summary>
        /// Limits the messges for which the registrant will receive the Added event
        /// for which they have registered
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="from">From object by which to filter broadcasts</param>
        void FilterAddedByFrom(object registrant, object from);
        /// <summary>
        /// Limits the messages for which the registerant will receive the Removed event
        /// for which they have registered
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="from">From object by which to filter broadcasts</param>
        void FilterRemovedByFrom(object registrant, object from);
        /// <summary>
        /// Removes a filter by type from the Added event
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="messageType">Type which is assignable to the message object (e.g. message inherits from it)</param>
        void RemoveFilterAddedByType(object registrant, Type messageType);
        /// <summary>
        /// Removes a filter by type from the Removed event
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="messageType">Type which is assignable to the message object (e.g. message implements it)</param>
        void RemoveFilterRemovedByType(object registrant, Type messageType);
        /// <summary>
        /// Removes a filter by Tag from the Added event
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="tag">Tag with which to filter broadcasts</param>
        void RemoveFilterAddedByTag(object registrant, object tag);
        /// <summary>
        /// Removes a filter by Tag from the Removed event
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="tag">Tag with which to filter broadcasts</param>
        void RemoveFilterRemovedByTag(object registrant, object tag);
        /// <summary>
        /// Removes a filter by Fun from the Added event
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="test">Function which will test the message entry</param>
        void RemoveFilterAddedByFunc(object registrant, Func<IBlackboardEntry, bool> test);
        /// <summary>
        /// Removes a filter by Func from the Removed event
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="tag">Function which will test the message entry</param>
        void RemoveFilterRemovedByFunc(object registrant, Func<IBlackboardEntry, bool> test);
        /// <summary>
        /// Removes a filter by From from the Added event
        /// </summary>
        /// <param name="registrant">Object which registered for the Added event</param>
        /// <param name="from">From object by which to filter broadcasts</param>
        void RemoveFilterAddedByFrom(object registrant, object from);
        /// <summary>
        /// Removes a filter by From from the Removed event
        /// </summary>
        /// <param name="registrant">Object which registered for the Removed event</param>
        /// <param name="from">From object by which to filter broadcasts</param>
        void RemoveFilterRemovedByFrom(object registrant, object from);
    }
}
